﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using OpenAPI.Common;

namespace OpenAPI.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;

        public WeatherForecastController(ILogger<WeatherForecastController> logger)
        {
            _logger = logger;
        }

        //[AllowAnonymous]
        [HttpGet]
        public IActionResult Get([FromQuery]Par par)
        {
            return Ok(new { aa = par.Id, bb = par.Name, cc = par.Country });
        }

        //[AllowAnonymous]
        [HttpPost]
        public IActionResult Post([FromForm]Par par)
        {
            return Ok(new { aa = par.Id, bb = par.Name, cc = par.Country });
        }

    }



}
